package com.font.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.font.bean.Domains;
import com.font.bean.DynamicValidateForm;
import com.font.bean.Introduce;
import com.font.bean.result.Result;
import com.font.mapper.IntroduceMapper;
import com.font.service.IntroduceService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (Introduce)表服务实现类
 *
 * @author makejava
 * @since 2023-07-11 15:27:18
 */
@Service("introduceService")
public class IntroduceServiceImpl extends ServiceImpl<IntroduceMapper, Introduce> implements IntroduceService {

    @Override
    public Result introList(DynamicValidateForm validateForm) {
        System.err.println(validateForm);
        List<Domains> domains = validateForm.getDomains();
        List<String> checkedCities = validateForm.getCheckedCities();

        String [] arr = new String[checkedCities.size()];
        for(String i:arr){
            System.out.println(i);
        }
        checkedCities.toArray(arr);

        List<Introduce> introduces=this.getBaseMapper().list(domains,arr,validateForm.getUsername());
        Result result = new Result();
        result.setData(introduces);
        return result;
    }
}
